package cc.aiee.core.pojo.vo;

import java.util.Map;

import com.alibaba.fastjson.JSONObject;

import lombok.Data;

@Data
public class HttpPrintVO {

	private String url;
	private String method;
	//协议 http ,https
	private String protocol;
	//端口
	private Integer port;
	private String ip;
	
	private Map<String,String> headers;
	
	private Map<String,Object> params;
	
	private String body;
	
	public String toJson() {
		return JSONObject.toJSONString(this, true);
	}

	@Override
	public String toString() {
		final String LF = "\n";
		StringBuilder sbl = new StringBuilder(LF);
		sbl.append("URL     : ").append(this.url).append(LF);
		sbl.append("protocol: ").append(this.protocol).append(LF);
		sbl.append("method  : ").append(this.method).append(LF);
		sbl.append("ip      : ").append(this.ip).append(LF);
		sbl.append("headers : ").append(JSONObject.toJSONString(this.headers, true)).append(LF);
		sbl.append("params  : ").append(JSONObject.toJSONString(this.params, true)).append(LF);
		sbl.append("body    : ").append(this.body).append(LF);
		return sbl.toString();
	}
	
	
}
